package cn.jorian.framework.controller;

import cn.jorian.framework.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/test")
public class TestController {

    @Autowired
    private RedisService redisService;

    @PostMapping("/setKey")
    public String setKey(@RequestParam String key, @RequestParam String value) {
//        String key = "youname";
//        String value = "hutao";
        redisService.setKey(key, value);
        return "执行成功";
    }

    @GetMapping("/getKey")
    public String getKey(@RequestParam String key) {
       return redisService.getKey(key);
    }
}
